<%@ page language="java" pageEncoding="UTF-8"
	import="com.lyk.swap.RiskProfit,com.lyk.swap.orm.Future"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />

<title>Trading Home</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css" href="ms.css">
<link rel="stylesheet" type="text/css" href="mshome.css">
<link rel="stylesheet" type="text/css" href="mstop.css">

<logic:notPresent name="userid" scope="session">
	<logic:redirect page="/user_error.jsp" />
</logic:notPresent>
<logic:notPresent name="rplist" scope="session">
	<logic:redirect page="/error.jsp" />
</logic:notPresent>
<logic:notPresent name="futurelist" scope="session">
	<logic:redirect page="/error.jsp" />
</logic:notPresent>
</head>

<body style="cursor: default;">
	<center>
		<div class="n_topNavBg">
			<div class="n_topNav">
				<div id="topBanner">
					<div id="logoAndLinks">
						<a href="http://www.morganstanley.com" id="logo"> <img
							src="img/logo-ms.gif" border="0" alt="Morgan Stanley">
						</a>
						<div id="topNavMod">
							<div align="right"></div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="n_bnrContainer">
			<div class="n_bnrBg" id="n_bannerBg">
				<h1>
					Trader&nbsp;
					<bean:write name="userid" scope="session" />
				</h1>
				<html:link action="/logout">Logout</html:link>
				<br />
				<h4>Swap</h4>
				<html:link action="/addTradePre">Add Swap</html:link>
				<table border="1" cellspacing="0" cellpadding="0">
					<tr>
						<th>id</th>
						<th>buy/sell</th>
						<th>product</th>
						<th>quantity</th>
						<th>start</th>
						<th>end</th>
						<th>price</th>
						<th>settlement</th>
						<th>risk</th>
						<th>profit</th>
					</tr>
					<logic:iterate id="rp" name="rplist" scope="session">
						<tr align="center">
							<td><a
								href="/swap_new/tradePre.do?tradeid=<%=((RiskProfit) rp).getTradeid().toString()%>">
									<bean:write name="rp" property="tradeid" />
							</a></td>
							<td><bean:write name="rp" property="formatBuy" /></td>
							<td><bean:write name="rp" property="formatCode" /></td>
							<td><bean:write name="rp" property="quantity" /></td>
							<td><bean:write name="rp" property="formatStart" /></td>
							<td><bean:write name="rp" property="formatEnd" /></td>
							<td><bean:write name="rp" property="formatPrice" /></td>
							<td><bean:write name="rp" property="settlement" /></td>
							<td><bean:write name="rp" property="risk" /></td>
							<td><bean:write name="rp" property="formatProfit" /></td>
						</tr>
					</logic:iterate>
				</table>
				<h4>Future</h4>
				<html:link action="/addFuturePre">Add Future</html:link>
				<table border="1" cellspacing="0" cellpadding="0">
					<tr>
						<th>id</th>
						<th>buy/sell</th>
						<th>product</th>
						<th>period</th>
						<th>quantity</th>
						<th>price</th>
						<th>risk</th>
						<th>profit</th>
					</tr>
					<logic:iterate id="future" name="futurelist" scope="session">
						<tr align="center">
							<td><a
								href="/swap_new/futurePre.do?futureid=<%=((Future) future).getFutureid().toString()%>">
									<bean:write name="future" property="futureid" />
							</a></td>
							<td><bean:write name="future" property="formatBuy" /></td>
							<td><bean:write name="future" property="formatCode" /></td>
							<td><bean:write name="future" property="formatPeriod" /></td>
							<td><bean:write name="future" property="quantity" /></td>
							<td><bean:write name="future" property="formatPrice" /></td>
							<td><bean:write name="future" property="formatRisk" /></td>
							<td><bean:write name="future" property="profit" /></td>
						</tr>
					</logic:iterate>
				</table>
			</div>
		</div>
		<div class="n_footerBg" id="footer">
			<div class="n_footer">By ISAD-SJTU. Author Yizhi Gu, Yunkai Luo and Rui Shi.</div>
		</div>
	</center>
</body>
</html:html>
